package com.example.jaden.washer;

import android.app.Application;

import java.util.ArrayList;
import java.util.List;

import dormitory.Dormitory;
import order.Order;
import student.Student;
import washer.Washer;


//整个应用的全局变量 继承application
public class MyApplication extends Application {

    //MyApplication的实例
    private static MyApplication app;
    private List<Washer>washerList=new ArrayList<>();
    private List<Order> orderList =new ArrayList<>();
    private List<Dormitory>dormitoryList=new ArrayList<>();
    private Dormitory curDorm;
    private Student student;
    private ResponseMessage responseMessage;
    /*
     * 用于实现访问网络请求中子线程与主线程的同步操作
     */
    private boolean isAllCommodity=true;
    private boolean isGetCommodityOk=false;
    private boolean isRegisterOk=false;
    private boolean isLoginOk=false;
    private boolean isCommitorderOK=false;
    private boolean isDeleteOK=false;
    private boolean isGetDormOK =false;
    private boolean isConfirmOK =false;
    private boolean isSelectOrderOK =false;
    private boolean isSavePersonalInfoOK=false;
    private boolean isGetCitizenInfoOk=false;
    private boolean isGetWasherOk =false;
    private  boolean isPayOk=false;


    @Override
    public void onCreate() {
        super.onCreate();
        app=this;
    }

    public boolean isPayOk() {
        return isPayOk;
    }

    public void setPayOk(boolean payOk) {
        isPayOk = payOk;
    }

    public Dormitory getCurDorm() {
        return curDorm;
    }

    public void setCurDorm(Dormitory curDorm) {
        this.curDorm = curDorm;
    }

    public boolean isGetWasherOk() {
        return isGetWasherOk;
    }

    public void setGetWasherOk(boolean getWasherOk) {
        isGetWasherOk = getWasherOk;
    }

    public List<Washer> getWasherList() {
        return washerList;
    }

    public void setWasherList(List<Washer> washerList) {
        this.washerList = washerList;
    }

    public void setOrderList(List<Order> orderList) {
        this.orderList = orderList;
    }

    public List<Order> getOrderList() {
        return orderList;
    }

    public List<Dormitory> getDormitoryList() {
        return dormitoryList;
    }

    public void setDormitoryList(List<Dormitory> dormitoryList) {
        this.dormitoryList = dormitoryList;
    }

    //获取此应用的实例
    public static MyApplication getInstance()
    {
        return app;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public ResponseMessage getResponseMessage() {
        return responseMessage;
    }

    public void setResponseMessage(ResponseMessage responseMessage) {
        this.responseMessage = responseMessage;
    }
    public boolean isAllCommodity() {
        return isAllCommodity;
    }

    public void setAllCommodity(boolean allCommodity) {
        isAllCommodity = allCommodity;
    }

    public boolean isGetCommodityOk() {
        return isGetCommodityOk;
    }

    public void setGetCommodityOk(boolean getCommodityOk) {
        isGetCommodityOk = getCommodityOk;
    }

    public boolean isRegisterOk() {
        return isRegisterOk;
    }

    public void setRegisterOk(boolean registerOk) {
        isRegisterOk = registerOk;
    }

    public boolean isLoginOk() {
        return isLoginOk;
    }

    public void setLoginOk(boolean loginOk) {
        isLoginOk = loginOk;
    }

    public boolean isCommitorderOK() {
        return isCommitorderOK;
    }

    public void setCommitorderOK(boolean commitorderOK) {
        isCommitorderOK = commitorderOK;
    }

    public boolean isDeleteOK() {
        return isDeleteOK;
    }

    public void setDeleteOK(boolean deleteOK) {
        isDeleteOK = deleteOK;
    }

    public boolean isGetDormOK() {
        return isGetDormOK;
    }

    public void setGetDormOK(boolean getDormOK) {
        isGetDormOK = getDormOK;
    }

    public boolean isConfirmOK() {
        return isConfirmOK;
    }

    public void setConfirmOK(boolean confirmOK) {
        isConfirmOK = confirmOK;
    }

    public boolean isSelectOrderOK() {
        return isSelectOrderOK;
    }

    public void setSelectOrderOK(boolean selectOrderOK) {
        isSelectOrderOK = selectOrderOK;
    }

    public boolean isSavePersonalInfoOK() {
        return isSavePersonalInfoOK;
    }

    public void setSavePersonalInfoOK(boolean savePersonalInfoOK) {
        isSavePersonalInfoOK = savePersonalInfoOK;
    }

    public boolean isGetCitizenInfoOk() {
        return isGetCitizenInfoOk;
    }

    public void setGetCitizenInfoOk(boolean getCitizenInfoOk) {
        isGetCitizenInfoOk = getCitizenInfoOk;
    }



}
